import { createRouter, createWebHashHistory } from "vue-router";

const routes = [
    {
        path: '/',
        name: 'root',
        component: () => import('@/views/root.vue'),
        children: [
            {
                path: "/",
                name: "default",
                component: () => import('@/components/root/default.vue')
            },
            {
                path: "index",
                name: "index",
                component: () => import('@/components/root/Index.vue')
            },
            {
                path: "user",
                name: "user",
                component: () => import('@/components/user/User.vue')
            },
            {
                path: "group",
                name: "group",
                component: () => import('@/components/user/Group.vue')
            },
            {
                path: "knowledge",
                name: "knowledge",
                component: () => import('@/components/user/Knowledge.vue')
            },
            {
                path: "hub",
                name: "hub",
                component: () => import('@/components/hub/Hub.vue')
            },
            {
                path: "setting",
                name: "setting",
                component: () => import('@/components/root/setting.vue')
            },
            {
                path: "chat",
                name: "chat",
                component: () => import('@/components/chat/Chat.vue')
            },
            {
                path: "ChatKnowledge",
                name: "ChatKnowledge",
                component: () => import('@/components/chat/ChatKnowledge.vue')
            },

            {
                path: "ChatSQL",
                name: "ChatSQL",
                component: () => import('@/components/chat/ChatSQL.vue')
            },
            {
                path: "ChatDatabase",
                name: "ChatDatabase",
                component: () => import('@/components/chat/ChatDatabase.vue')
            },
            {
                path: "ChatAll",
                name: "ChatAll",
                component: () => import('@/components/chat/ChatAll.vue')
            },
        ]
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/login.vue')
    },
    {
        path: '/register',
        name: 'register',
        component: () => import('@/views/register.vue')
    }
];

export default createRouter({
    history: createWebHashHistory(),
    routes,
});
